package DataAccess.Storage;

import java.io.Serializable;

import BackGround.BgImage;

/**
 * Title:        iPAD
 * Description:
 * Copyright:    Copyright (c) 2002
 * Company:      ABB Inc.
 * @author Fangxing Li
 * @version 1.0
 */

public class BgImageForStorage implements Serializable{
  public static final long serialVersionUID=100207L;

  protected String  sImageSource;
  protected int     iX1Stored;
  protected int     iY1Stored;
  protected int     iX2Stored;
  protected int     iY2Stored;

  public BgImageForStorage() { }

  public void copyFromBgImage( BgImage bgImage ){
      this.sImageSource = bgImage.getImageSource();
      this.iX1Stored = bgImage.getElemGeomObj().x1Stored;
      this.iY1Stored = bgImage.getElemGeomObj().y1Stored;
      this.iX2Stored = bgImage.getElemGeomObj().x2Stored;
      this.iY2Stored = bgImage.getElemGeomObj().y2Stored;
  }

  public BgImage createBgImageFromThis() throws Exception{
      BgImage bgImage = new BgImage(  this.sImageSource ); //, null );
      bgImage.initFromStored( iX1Stored, iY1Stored, iX2Stored, iY2Stored );
      return bgImage;
  }
}